<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<c:import url="/head.jsp"></c:import>
<script
	src="<%=request.getContextPath()%>/scripts/My97DatePicker4/WdatePicker.js"></script>
<c:import url="/deptselectInner.jsp"></c:import>
<script src="<%=request.getContextPath()%>/scripts/jquery.form.js"></script>
<script
	src="<%=request.getContextPath()%>/scripts/submitcheck.js"></script>
<script type="text/javascript">

String.prototype.trim = function(){
	return this.replace(/(^\s*)|(\s*$)/g, "");
};

function bopt( k ){
	$("#opt").val(k) ;
}

var f = null;

function check(formData, jqForm, options) {
	if (f.perPublishDepart.value == ""){
		alert("必须选择信用信息发布管理部门");
		return false;
	}
	if (f.personName.value == ""){
		alert("必须填写姓名");
		f.personName.focus();
		return false;
	}
	if (f.opt.value=='3'){
		f.rejectReason.value = f.rejectReason.value.trim();
		if (f.rejectReason.value==''){
			f.rejectReason.focus();
			alert("审核未通过时必须填写审核未通过意见");
			return false;
		}
	}

	if (f.perPublishDepartShow.value == ""){
		alert("必须选择矿业权审批和出让管理部门");
		return false;
	}
	
	if(f.perPublishDepart.value.substring(8,9)<2){
		alert(f.perPublishDepartShow.value+"不能选做审批部门，请选择具体的审批部门");
		return false;
	}
	
	return true;
}

</script>
<body leftmargin="0" rightmargin="0" topmargin="0" >

<form id="form1" name="form1" method="post" action="<c:url value="/admin/savePersonInfo/"/>" onsubmit="return false">

<table border="0" align="center" width="100%">
	<tr>
		<td> <input type="submit" value="回到列表" class="btn80"
			onclick="location.href='<c:url value="/admin/editPersonList?proCode=${proCode}" />';return false;" /></td>
	</tr>
</table>
<%@include file="personForm.jsp"%>

<table align="center" width="100%" id="optbtn">
	<tr>
		<td align="center"><input type="hidden" id="opt" name="opt"
			value="1" /><input type="hidden" name="proCode" value="${proCode}" />
			<c:if test="${show == 1}">
				<input type="submit" value="保  存" onclick="bopt(1)" class="bnt60" />
			</c:if>
		</td>
	</tr>
</table>
<input type="hidden" id="newId" name="perId" value="${personBaseInfo.perID}" />
</form>
<script type="text/javascript">

window.onload=function (){

	f = document.getElementById("form1");

	var options={type:"POST", dataType:"json", beforeSubmit:check, success:resultResponse};
	$('#form1').ajaxForm(options);
}

</script>
</body>
</html>
